<div class="resource-details">
  <div class="row">
    <div class="col-lg-6">
      <h3>
        Status
        <small ng-if="pod | isDebugPod">
          debugging
          <a ng-href="{{pod | debugPodSourceName | navigateResourceURL : 'Pod' : pod.metadata.namespace}}">{{pod | debugPodSourceName}}</a>
        </small>
      </h3>
      <dl class="dl-horizontal left">
        <dt>Status:</dt>
        <dd>
          <status-icon status="pod | podStatus"></status-icon>
          {{pod | podStatus | humanizePodStatus}}<span ng-if="pod | podCompletionTime">, ran for {{(pod | podStartTime) | duration : (pod | podCompletionTime)}}</span>
          <span ng-if="pod.metadata.deletionTimestamp">(expires {{pod.metadata.deletionTimestamp | date : 'medium'}})</span>
        </dd>
        <dt ng-if-start="pod.status.message">Message:</dt>
        <dd ng-if-end>{{pod.status.message}}</dd>
        <dt ng-if-start="dcName">
          Deployment:
        </dt>
        <dd ng-if-end>
          <a ng-href="{{dcName | navigateResourceURL : 'DeploymentConfig' : pod.metadata.namespace}}">{{dcName}}</a><span ng-if="rcName">,
          <a ng-href="{{rcName | navigateResourceURL : 'ReplicationController' : pod.metadata.namespace}}"
            ><span ng-if="deploymentVersion">#{{deploymentVersion}}</span><span ng-if="!deploymentVersion">{{rcName}}</span></a></span>
        </dd>
        <dt ng-if-start="!dcName && controllerRef">
          {{controllerRef.kind | humanizeKind : true}}:
        </dt>
        <dd ng-if-end>
          <a ng-href="{{controllerRef.name | navigateResourceURL : controllerRef.kind : pod.metadata.namespace}}">{{controllerRef.name}}</a>
        </dd>
        <dt ng-if-start="pod.metadata.deletionTimestamp && pod.spec.terminationGracePeriodSeconds">Grace Period:</dt>
        <dd ng-if-end>
          <!-- Don't show "a few seconds" for small values. -->
          <span ng-if="pod.spec.terminationGracePeriodSeconds < 60">
            {{pod.spec.terminationGracePeriodSeconds}} seconds
          </span>
          <span ng-if="pod.spec.terminationGracePeriodSeconds >= 60">
            {{pod.spec.terminationGracePeriodSeconds | humanizeDurationValue : 'seconds'}}
          </span>
        </dd>
        <dt>IP:</dt>
        <dd>{{pod.status.podIP || 'unknown'}}</dd>
        <dt>Node:</dt>
        <dd>{{pod.spec.nodeName || 'unknown'}} <span ng-if="pod.status.hostIP && pod.spec.nodeName != pod.status.hostIP">({{pod.status.hostIP}})</span></dd>
        <dt>Restart Policy:</dt>
        <dd>{{pod.spec.restartPolicy || 'Always'}}</dd>
        <dt ng-if-start="pod.spec.activeDeadlineSeconds">Active Deadline:</dt>
        <dd ng-if-end>
          <!-- Don't show "a few seconds" for small values. -->
          <span ng-if="pod.spec.activeDeadlineSeconds < 60">
            {{pod.spec.activeDeadlineSeconds}} seconds
          </span>
          <span ng-if="pod.spec.activeDeadlineSeconds >= 60">
            {{pod.spec.activeDeadlineSeconds | humanizeDurationValue : 'seconds'}}
          </span>
          <span ng-if="pod.status.phase === 'Running' && pod.status.startTime" class="text-muted">
            (<duration-until-now timestamp="pod.status.startTime"></duration-until-now> elapsed)
          </span>
        </dd>
      </dl>
      <div>
        <container-statuses
          pod="pod"
          on-debug-terminal="debugTerminal"
          detailed="true"></container-statuses>
      </div>
    </div>
    <div class="col-lg-6">

      <h3>Template</h3>
      <pod-template
        pod-template="pod"
        images-by-docker-reference="imagesByDockerReference"
        builds="builds"
        detailed="true">
      </pod-template>

      <h4>Volumes</h4>
      <volumes ng-if="pod.spec.volumes.length" volumes="pod.spec.volumes" namespace="project.metadata.name"></volumes>
      <div ng-if="!pod.spec.volumes.length">none</div>

      <p ng-if="dcName && (deploymentConfigsVersion | canI : 'update')">
        <a ng-href="project/{{project.metadata.name}}/attach-pvc?kind=DeploymentConfig&name={{dcName}}">Add Storage to {{dcName}}</a>
        <span class="action-divider" aria-hidden="true">|</span>
        <a ng-href="project/{{project.metadata.name}}/add-config-volume?kind=DeploymentConfig&name={{dcName}}">Add Config Files to {{dcName}}</a>
      </p>
    </div>
  </div>
  <annotations annotations="pod.metadata.annotations"></annotations>
</div>
